home *** CD-ROM | disk | FTP | other *** search
- (*===========================================================================*)
- (* Binary Xfer miscellanous routines *)
- (* *)
- (* Copyright 1989 by H. Roy Engehausen. All rights reserved. *)
- (* *)
- (*===========================================================================*)
-
- (*===========================================================================*)
- (* Do mess *)
- (*===========================================================================*)
-
- PROCEDURE do_mess_local(mess_no : BYTE);
-
- VAR
- pt : POINTER;
- s : STRING;
-
- BEGIN;
- pt := find_task_mem_addr('$1');
- IF pt = NIL THEN
- set_dollar1_parm(@bin_mode);
- s := get_message(mess_no);
- window_write(p, s);
- END;
-
- PROCEDURE do_mess (mess_no : BYTE);
-
- VAR
- pt : POINTER;
-
- BEGIN;
- IF conv_sw THEN
- do_mess_local(mess_no)
- ELSE
- BEGIN;
- pt := find_task_mem_addr('$1');
- IF pt = NIL THEN
- set_dollar1_parm(@bin_mode);
- send_message(mess_no);
- END;
- END;
-
- (*===========================================================================*)
- (* Flush any input buffers *)
- (*===========================================================================*)
-
- PROCEDURE flush_input_buffers;
- BEGIN;
- WHILE active_tcb^.c_input <> NIL DO
- del_c_string(active_tcb);
- END;
-
- (*===========================================================================*)
- (* Common code for clean up *)
- (*===========================================================================*)
-
- PROCEDURE close_things_up;
-
- VAR
- io_code : INTEGER;
-
- BEGIN;
-
- (*-----------------------------------------------------------------------*)
- (* Obtain the interrupt semaphore *)
- (*-----------------------------------------------------------------------*)
-
- get_semaphore(semaphore_interrupts, sem_exclusive, FALSE);
-
- (*-----------------------------------------------------------------------*)
- (* Close up the file element if still here and thorw it away *)
- (*-----------------------------------------------------------------------*)
-
- IF active_tcb^.io_fe <> NIL THEN
- BEGIN;
- {$I-}
- CLOSE(active_tcb^.io_fe^.fe_bin);
- io_code := IORESULT;
- {$I+}
- DISPOSE(active_tcb^.io_fe);
- active_tcb^.io_fe := NIL;
- END;
-
- (*-----------------------------------------------------------------------*)
- (* Drop the interrupt semaphore *)
- (*-----------------------------------------------------------------------*)
-
- free_semaphore(semaphore_interrupts);
-
- (*-----------------------------------------------------------------------*)
- (* Flush things *)
- (*-----------------------------------------------------------------------*)
-
- read_flush;
-
- END;